package org.nico.cb.section;

import org.nico.aoc.aspect.AspectProxy;
import org.nico.aoc.aspect.point.AspectPoint;
import org.nico.aoc.aspect.point.ProcessingAspectPoint;
import org.nico.aoc.scan.annotations.After;
import org.nico.aoc.scan.annotations.Around;
import org.nico.aoc.scan.annotations.Aspect;
import org.nico.aoc.scan.annotations.Before;
import org.nico.aoc.scan.annotations.Wrong;

//@Aspect
public class ReuqestSection implements AspectProxy{

	@Override
	@Before(value = "expression(org.nico.ct.controller.*.*(..))")
	public void before(AspectPoint point) {
		System.out.println("already reqeust");
		
	}

	@Override
	@Around(value = "expression(org.nico.ct.controller.*.*(..))")
	public Object around(ProcessingAspectPoint point) {
		
		Object result = null;
		try {
			result = point.process();
		} catch (Throwable e) {
			e.printStackTrace();
		}
		return result;
	}

	@Override
	@After(value = "expression(org.nico.ct.controller.*.*(..))")
	public void after(AspectPoint point) {
		System.out.println("after request");
		
	}

	@Override
	@Wrong(value = "expression(org.nico.ct.controller.*.*(..))")
	public void wrong(ProcessingAspectPoint point, Throwable throwable) throws Throwable {
		// TODO Auto-generated method stub
		
	}

}
